package com.zhenyi.fenda.model;

import java.util.Date;
import java.util.List;

import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.IndexOptions;
import org.mongodb.morphia.annotations.Indexed;

@Entity("Question")
public class Question {
	@Id
	private String id;
	private String title;
	@Indexed(options = @IndexOptions(unique = true))
	private String url;
	private String cover;
	private String author;
	private Date addTime = new Date();
	private String content;
	private List<String> images;
	// @Embedded
	private User user;

	@Indexed(options = @IndexOptions(expireAfterSeconds = 5))
	private Date offerExpiresAt;// = new Date();

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<String> getImages() {
		return images;
	}

	public void setImages(List<String> images) {
		this.images = images;
	}

	public Date getOfferExpiresAt() {
		return offerExpiresAt;
	}

	public void setOfferExpiresAt(Date offerExpiresAt) {
		this.offerExpiresAt = offerExpiresAt;
	}

}
